﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Diet;

namespace Logic
{
    public class calorificCalculator
    {
        public int VegetableCalculate (int count, AbstractVegetables vegetable)
        {
            return vegetable.Calorific_value * count;
        }
        public int Calculate(Salad salad)
        {
            int calory = 0;
            List<AbstractVegetables> vegetables = salad.Vegetables;
            foreach (AbstractVegetables vegetable in vegetables)
            {
                calory += vegetable.Calorific_value;
            }
            return calory;
        }
        public int price(Salad salad)
        {
            int price = 0;
            List<AbstractVegetables> vegetables = salad.Vegetables;
            foreach (AbstractVegetables vegetable in vegetables)
            {
                price += vegetable.Price;
            }
            return price;
        }
    }
}
